import request from '@/utils/request'

// 获取客户列表 http://120.48.60.110/tp5/public/query/get_customer_all
export function getCustomerListAPI(params) {
  return request({
    url: '/public/query/get_customer_pagination',
    method: 'GET',
    params
  })
}

// 删除  /public/delete/del_customer/
export function deleteCustomerAPI(data) {
  return request({
    url: '/public/delete/del_customer',
    method: 'POST',
    data
  })
}

// 新增
export function addCustomerAPI(data) {
  return request({
    url: '/public/add/add_customer',
    method: 'POST',
    data
  })
}

// 编辑用户
export function editCustomerAPI(data) {
  return request({
    url: '/public/update/update_customer',
    method: 'POST',
    data
  })
}


// 批量删除
export function deleteBatchCustomerAPI(data) {
  return request({
    url: '/public/delete/del_customer_more',
    method: 'POST',
    data
  })
}

// 获取客户信息详情
export function getCustomerDetailAPI(params) {
  return request({
    url: `/public/query/get_customer_one?cid=${params}`,
    method: 'GET'
  })
}

// 新增地址  /public/add/add_reciver_address_info
export function addAddressAPI(data){
  return request({
    url: `/public/add/add_reciver_address_info`,
    method: 'POST',
    data
  })
}

// 删除地址
export function deleteAddressAPI(data) {
  return request({
    url: '/public/delete/del_reciver_address_info',
    method: 'POST',
    data
  })
}

// 获取地址详情
export function getAddressDetailAPI(params) {
  return request({
    url: `/public/query/get_customer_address_detail?aid=${params}`,
    method: 'GET'
  })
}

// 编辑地址 
export function editAddressAPI(data) {
  return request({
    url: '/public/update/update_address_info',
    method: 'POST',
    data
  })
}

// 地址信息列表
export function getAddressListAPI(params) {
  return request({
    url: '/public/query/get_reciver_address_info',
    method: 'GET',
    params
  })
}


// 增加开票信息 
export function addInvoiceAPI(data){
  return request({
    url: `/public/add/add_customer_invoice_info`,
    method: 'POST',
    data
  })
}

// 获取开票列表
export function getInvoiceListAPI(params) {
  return request({
    url: '/public/query/get_customer_invoice_info',
    method: 'GET',
    params
  })
}

// 删除开票信息
export function deleteInvoiceAPI(data) {
  return request({
    url: '/public/delete/del_customer_invoice_info',
    method: 'POST',
    data
  })
}

// 获取开票详情
export function getInvoiceDetailAPI(params) {
  return request({
    url: `/public/query/get_customer_invoice_detail?in_id=${params}`,
    method: 'GET'
  })
}

// 编辑开票信息 /public/update/update_customer_invoice_info
export function editInvoiceAPI(data) {
  return request({
    url: '/public/update/update_customer_invoice_info',
    method: 'POST',
    data
  })
}


// 查看客户详情 (地址/开票)
export function getCustomerAllDataDetailAPI(params) {
  return request({
    url: `/public/query/get_customer_all_info?cid=${params}`,
    method: 'GET'
  })
}